package com.example.springboot.mapper;

import com.example.springboot.entity.CComment;
import com.example.springboot.entity.SComment;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author author
 * @since 2022-03-27
 */
public interface SCommentMapper extends BaseMapper<SComment> {

    @Select("select s.*,u.nickname,u.profilepic from s_comment s left join user u on s.user_id = u.id " +
            "where s.solution_id = #{solution_id} order by id desc")
    List<SComment> getCommentsBySolution(Integer solution_id);

}
